
function sleep(timeout) {
    return new Promise((resolve) => {
        setTimeout(() => {
            resolve();
        }, timeout);
    })
}

const duration = 1000;
let a = '';
let b = '';
let c = ''

Promise.resolve(sleep(duration)).then(() => {
    a = 'hello';
    return sleep(duration);
}).then(() => {
    b = 'lagou';
    return sleep(duration);
}).then(() => {
    c = 'I love U';
    console.log(a + b + c);
});
